// edit_matrix.h
//
// Edit a Rivendell Matrix
//
//   (C) Copyright 2002-2003 Fred Gleason <fredg@paravelsystems.com>
//
//      $Id: edit_matrix.h,v 1.10 2007/10/24 18:54:03 fredg Exp $
//
//   This program is free software; you can redistribute it and/or modify
//   it under the terms of the GNU General Public License version 2 as
//   published by the Free Software Foundation.
//
//   This program is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//   GNU General Public License for more details.
//
//   You should have received a copy of the GNU General Public
//   License along with this program; if not, write to the Free Software
//   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//

#ifndef EDIT_MATRIX_H
#define EDIT_MATRIX_H

#include <qdialog.h>
#include <qsqldatabase.h>
#include <qcombobox.h>
#include <qspinbox.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qpushbutton.h>

#include <rduser.h>
#include <rdmatrix.h>

class EditMatrix : public QDialog
{
 Q_OBJECT
 public:
  EditMatrix(RDMatrix *matrix,QWidget *parent=0,const char *name=0);
  QSize sizeHint() const;
  QSizePolicy sizePolicy() const;

 private slots:
  void portTypeActivatedData(int index);
  void inputsButtonData();
  void outputsButtonData();
  void xpointsButtonData();
  void gpisButtonData();
  void livewireButtonData();
  void vguestRelaysButtonData();
  void vguestDisplaysButtonData();
  void gpisChangedData(int value);
  void gposChangedData(int value);
  void okData();
  void cancelData();

 private:
  bool WriteMatrix();
  RDMatrix *edit_matrix;
  QString edit_stationname;
  int edit_matrix_number;
  QLineEdit *edit_name_edit;
  QLabel *edit_porttype_label;
  QComboBox *edit_porttype_box;
  QLabel *edit_ipaddress_label;
  QLineEdit *edit_ipaddress_edit;
  QLabel *edit_ipport_label;
  QSpinBox *edit_ipport_spin;
  QLabel *edit_username_label;
  QLineEdit *edit_username_edit;
  QLabel *edit_password_label;
  QLineEdit *edit_password_edit;
  QLabel *edit_port_label;
  QComboBox *edit_port_box;
  QLabel *edit_inputs_label;
  QSpinBox *edit_inputs_box;
  QLabel *edit_outputs_label; 
  QSpinBox *edit_outputs_box;
  QPushButton *edit_inputs_button;
  QPushButton *edit_outputs_button;
  QPushButton *edit_xpoint_button;
  QPushButton *edit_gpis_button;
  QPushButton *edit_livewire_button;
  QPushButton *edit_vguestrelays_button;
  QPushButton *edit_vguestdisplays_button;
  QLabel *edit_device_label;
  QLineEdit *edit_device_edit;
  QLabel *edit_gpis_label;
  QSpinBox *edit_gpis_box;
  QLabel *edit_gpos_label;
  QSpinBox *edit_gpos_box;
  QLabel *edit_card_label;
  QSpinBox *edit_card_box;
  QLabel *edit_displays_label;
  QSpinBox *edit_displays_box;
};


#endif

